from base import mysqlConnect, log


def dateToMinutes(fromtime, totime):
    fromtime_list = fromtime.split("-")
    totime_list = totime.split("-")
    sub_minutes = int(totime_list[1]) - int(fromtime_list[1]) + (int(totime_list[0]) - int(fromtime_list[0])) * 60
    return sub_minutes


def subspace(init_string):
    final_string = init_string.replace(' ', '').replace('\n', '').replace('\t','')
    # final_string = init_string.replace('\t', ',')
    return final_string

def compare(str1, str2):
    index = 0
    for i in range(len(str1)):
        if str1[i] == str2[i]:
            index = i
    return index

